Skip to content

refactor(tok): split oversized files for code clarity#59

Merged
Patel230 merged 2 commits into
mainfrom
refactor/code-clarity
Jun 19, 2026
Merged

refactor(tok): split oversized files for code clarity#59
Patel230 merged 2 commits into
mainfrom
refactor/code-clarity

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

Pure mechanical refactor for code clarity only — split two oversized Go files (>1000 LOC) into smaller, cohesive, same-package files. Code was moved verbatim; no behavior, API, or exported-symbol changes.

Splits (before → after LOC)

Original file Before After New file New LOC
chunker.go 1026 764 chunker_extensions.go 270
integration_test.go 1056 594 integration_advanced_test.go 473

chunker.gochunker_extensions.go

Moved the large extensionLanguageMap data literal and DetectLanguageByExtension (extension→language mapping) out of chunker.go.

integration_test.gointegration_advanced_test.go

Moved the Performance, Configuration, concurrency, CompactionSchema, and token-estimation-precision integration tests out of integration_test.go. The original retains the full-pipeline, reversibility, token-estimation, language-detection, and edge-case sections.

All files are now under 1000 LOC. No file was intentionally left over 1000.

Verification

  • goimports -w on all touched files
  • go build ./... — green
  • go vet ./... — green
  • go test ./... — all packages pass
  • golangci-lint run on the root package — 0 issues

No cgo needed (pure-Go module; modernc.org/sqlite).

Made with Cursor

Patel230 added 2 commits June 19, 2026 20:59
Move the extensionLanguageMap literal and DetectLanguageByExtension into
a new same-package file chunker_extensions.go to keep chunker.go under
1000 LOC. Pure mechanical move; no behavior or API changes.
Move the Performance, Configuration, concurrency, CompactionSchema, and
token-estimation-precision integration tests into a new same-package file
integration_advanced_test.go to keep integration_test.go under 1000 LOC.
Pure mechanical move; no test behavior changes.
@Patel230 Patel230 force-pushed the refactor/code-clarity branch from 7a56535 to 0bd9de8 Compare June 19, 2026 15:33
@Patel230 Patel230 merged commit 0c99da3 into main Jun 19, 2026
20 checks passed
@Patel230 Patel230 deleted the refactor/code-clarity branch June 19, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant